/*zeno.c -- 求序列的和*/

#include "stdio.h"

int main(void){

    int ct;
    double time,power_of_2;
    int limit;
    printf("limit的值:");
    scanf("%d",&limit);
    for(time=0, power_of_2=1, ct=1; ct <= limit;ct++, power_of_2=2.0){
        time += 1.0 / power_of_2;
        printf("time=%f,ct=%d\n",time,ct);
        // printf("power_of_2=%f\n",power_of_2);
    }

    return 0;
}